package qimao.com.edu.entity;

import jakarta.persistence.*;

import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 目录表
 * @author 86173
 *
 */
@Entity
@Table(name = "chapters")
public class Chapters {
	/**
	 * 作品ID
	 */
    @Id
    @Column(name = "work_id", nullable = false)
    private Integer workId;
    /**
     * 章节ID
     */
    @Id
    @Column(name = "chapter_id", nullable = false)
    private Integer chapterId;
    /**
     * 章节名
     */
    @Column(name = "chapter_title", nullable = false, length = 100)
    private String chapterTitle;
    /**
     * 内容地址
     */
    @Column(name = "content_path", nullable = false, length = 255)
    private String contentPath;
    /**
     * 字数
     */
    @Column(name = "word_count", nullable = false, columnDefinition = "INT UNSIGNED DEFAULT 0")
    private Integer wordCount;
    /**
     * 更新时间
     */
    @Column(name = "update_time", nullable = false)
    private LocalDateTime update_time;
    
	public Chapters() {
		super();
	}

	public Chapters(Integer workId, Integer chapterId, String chapterTitle, String contentPath, Integer wordCount,
			LocalDateTime update_time) {
		super();
		this.workId = workId;
		this.chapterId = chapterId;
		this.chapterTitle = chapterTitle;
		this.contentPath = contentPath;
		this.wordCount = wordCount;
		this.update_time = update_time;
	}

	public Integer getWorkId() {
		return workId;
	}

	public void setWorkId(Integer workId) {
		this.workId = workId;
	}

	public Integer getChapterId() {
		return chapterId;
	}

	public void setChapterId(Integer chapterId) {
		this.chapterId = chapterId;
	}

	public String getChapterTitle() {
		return chapterTitle;
	}

	public void setChapterTitle(String chapterTitle) {
		this.chapterTitle = chapterTitle;
	}

	public String getContentPath() {
		return contentPath;
	}

	public void setContentPath(String contentPath) {
		this.contentPath = contentPath;
	}

	public Integer getWordCount() {
		return wordCount;
	}

	public void setWordCount(Integer wordCount) {
		this.wordCount = wordCount;
	}

	public LocalDateTime getUpdate_time() {
		return update_time;
	}

	public void setUpdate_time(LocalDateTime update_time) {
		this.update_time = update_time;
	}

	@Override
	public String toString() {
		return "Chapters [workId=" + workId + ", chapterId=" + chapterId + ", chapterTitle=" + chapterTitle
				+ ", contentPath=" + contentPath + ", wordCount=" + wordCount + ", update_time=" + update_time + "]";
	}
    
}